import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("clueprice")
class Clueprice extends BaseService {
	// 接单列表
	page({ size, ...args }) {
		let params = {
			page_size: size,
			...args
		};
		return this.$get("/lists", { params }).then(res => {
			return {
				list: res.data.map(v => ({
					...v,
					region: JSON.parse(v.address)
				})),
				pagination: {
					size,
					...params,
					total: res.total
				}
			};
		});
	}
	// 新增
	add(params) {
		return this.$post("/edit", params);
	}
	// 更新，包含 id
	update(params) {
		return this.$post("/edit", params);
	}
	// 删除
	remove(params) {
		return this.$post("/remove", params);
	}
}
export default Clueprice;
